<template>
	<view>
		<!-- <image class="bg" mode="widthFix" src="@/static/imgs/head45.png"></image> -->
		<view class="cantainer">
			<view v-for="i in list" :key="i.id" @click="detail(i)">
				<view class="whiteBox mtb20" @click="warnPage">
					<view class="flexR">
						<image style="width: 20px; margin: -4px 4px 0 0;" mode="widthFix" src="@/static/imgs/icon-warn.png"></image>
						{{ i.driverName }}
						<span class="flow"></span>
						<uni-icons type="right" color="#999" size="20"></uni-icons>
					</view>
					<view style="height: 10px;"></view>
					<view class="flexR">
						<image class="imgs" mode="widthFix" src="@/static/imgs/icon-time.png"></image>
						<span class="c80">{{ i.updateTime }}</span>
						<view class="flow"></view>
						<image class="imgs" mode="widthFix" src="@/static/imgs/icon-localtion.png"></image>
						<span class="c80">{{ i.address || '暂无' }}</span>
					</view>
				</view>
			</view>
			<view v-if="!list.length" class="kong">暂无数据</view>
		</view>
		<view></view>
	</view>
</template>

<script>
import listWarn from '@/components/listWarn.vue';
export default {
	components: { listWarn },
	data() {
		return {
			list: [],

		};
	},
	onLoad() {
		this.getList()
	},
	methods: {
		detail(i) {
			// uni.navigateTo({
			// 	url: `/pages/warn?id=${i.modelId}&doId=${i.id}&type=1`
			// });
		},
		getList() {
			this.$axios({
				method: 'get',
				url: '/senor/warn/appNews',
			}).then(res => {
				this.list = res.rows;
			})
		}
	}
}
</script>

<style lang="scss" scoped>
.mr20 {
	margin-right: 20px;
}

.imgs {
	width: 15px;
	height: 15px;
	margin-right: 5px;
}
</style>